<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>zmall网上商城后台</title>
<link rel="stylesheet" href="css_cz/layui/css/layui.css">
<link rel="stylesheet" href="css_cz/css/global.css">
<link rel="stylesheet" href="css_cz/icheck/minimal/red.css">
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<!-- 顶部栏和左侧菜单栏 -->
		<jsp:include page="MenuBar.html"></jsp:include>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px;">
				<fieldset class="layui-elem-field">
					<legend>个人管理 - 个人信息</legend>
					<div class="layui-field-box">
						<form class="layui-form" action="">
							<div class="layui-form-item" style="text-align: center;">
								<div class="layui-inline"></div>

							</div>
						</form>
						<hr>
						<table class="layui-table">
							<colgroup>
								<col width="50">
								<col width="50">
								<col width="150">
								<col width="100">

								<col width="100">
								<col width="100">
								<col width="200">
							</colgroup>
							<thead>
								<tr>
									<th>序号</th>
									<th>管理员姓名</th>
									<th>帐号</th>
									<th>入职时间</th>
									<th style="text-align: center;">操作</th>
								</tr>
							</thead>
							<tbody>
								<!-- 判断接收的list是否为空，是的话 跳转到  BackstageServlet -->
								<c:if test="${admin==null}">
									<c:redirect url="BackstageServlet?op=querypersonal"></c:redirect>
								</c:if>
								<c:if test="${admin!=null}">
									<tr>
										<td>${admin.adminid}</td>
										<td>${admin.adminname}</td>
										<td>${admin.adminuser}</td>
										<td>${admin.admindate}</td>
										<td><a href="#" class="updateadmin">修改密码</a></td>
									</tr>
								</c:if>
							</tbody>
						</table>
					</div>
				</fieldset>
			</div>
		</div>

		<div class="layui-footer">
			<!-- 底部固定区域 -->
			©zmall后台管理
		</div>
	</div>
	<script type="text/javascript" src="css_cz/javascript/jquery.min.js"></script>
	<script type="text/javascript" src="css_cz/layui/layui.js"></script>
	<script type="text/javascript" src="css_cz/icheck/icheck.js"></script>
	<script type="text/javascript" src="css_cz/javascript/dw.js"></script>
	<script src="css_cz/layui/layui.js"></script>
	<script>
		layui.use([ 'laypage', 'layer' ], function() {
			var laypage = layui.laypage, layer = layui.layer;
			$(".updateadmin").click(function() {
				var adminuser = $(this).parents("tr").find("td").eq(2).text();
				$("#adminuser").val(adminuser);
				layer.open({
					type : 1,
					area : [ '500px', '400px' ],
					content : $('#updatediv')
				//这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
				});
			});
		});
	</script>
	<div id="updatediv" style="display: none; width: 350px" align="center">

		<form class="layui-form" action="BackstageServlet?op=updatepwd">
			<hr>
			<div class="layui-form-item">
				<label class="layui-form-label">用户名</label>
				<div class="layui-input-block">
					<input type="text" name="adminuser" id="adminuser" required
						lay-verify="required" readonly class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">原本密码</label>
				<div class="layui-input-block">
					<input type="password" name="pwd0" id="pwd0" required
						lay-verify="required" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">修改密码</label>
				<div class="layui-input-block">
					<input type="password" name="pwd1" id="pwd1" required
						lay-verify="required" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">确认密码</label>
				<div class="layui-input-block">
					<input type="password" name="pwd2" id="pwd2" required
						lay-verify="required" class="layui-input">
				</div>
			</div>


			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="updatepwd">立即修改</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>

	</div>
</body>
</html>